<template>
    <div>
        <el-form label-position="left" label-width="100px" v-model="label">
          <el-divider content-position="center">标签</el-divider>
            <el-form-item label="显示">
              <el-radio v-model="label.show" :label="true">是</el-radio>
              <el-radio v-model="label.show" :label="false">否</el-radio>
            </el-form-item>
            <el-form-item  label="位置">
               <el-select v-model="label.position" placeholder="top" size="mini">
                <el-option label="上" value="top"/>
                <el-option label="下" value="bottom"/>
                <el-option label="左" value="left"/>
                <el-option label="右" value="right"/>
                <el-option label="内部" value="inside"/>
                <el-option label="内上" value="insideTop"/>
                <el-option label="内下" value="insideBottom"/>
                <el-option label="内左" value="insideLeft"/>
                <el-option label="内右" value="insideRight"/>
              </el-select>
            </el-form-item>
            <el-form-item  label="间距">
              <el-input-number v-model="label.distance" :min="0" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="旋转">
              <el-input-number v-model="label.rotate" :min="-90" :max="90" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="水平偏移">
              <el-input-number v-model="label.offset[0]" :min="-100" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="垂直偏移">
              <el-input-number v-model="label.offset[1]" :min="-100" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item label="格式">
              <el-input v-model="label.formatter" v-if="!!label.formatter" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="颜色">
              <el-color-picker v-model="label.color" show-alpha size="small" @active-change="labelColor"></el-color-picker>
            </el-form-item>
            <el-form-item  label="字体">
               <el-select v-model="label.fontFamily" placeholder="serif" size="mini">
                <el-option label="serif" value="serif"/>
                <el-option label="monospace" value="monospace"/>
                <el-option label="Courier New" value="Courier New"/>
                <el-option label="Microsoft YaHei" value="Microsoft YaHei"/>
              </el-select>
            </el-form-item>
            <el-form-item  label="字号">
              <el-input-number v-model="label.fontSize" :min="0" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="粗细">
              <el-select v-model="label.fontWeight" placeholder="normal" size="mini">
                <el-option label="normal" value="normal"/>
                <el-option label="bold" value="bold"/>
                <el-option label="bolder" value="bolder"/>
                <el-option label="lighter" value="lighter"/>
              </el-select>
            </el-form-item>
        </el-form>
        <el-divider content-position="center">强调样式</el-divider>
        <el-form label-position="left" label-width="100px" v-model="emphasis">
            <el-form-item label="显示">
              <el-radio v-model="emphasis.label.show" :label="true">是</el-radio>
              <el-radio v-model="emphasis.label.show" :label="false">否</el-radio>
            </el-form-item>
            <el-form-item  label="位置">
               <el-select v-model="emphasis.label.position" placeholder="top" size="mini">
                <el-option label="上" value="top"/>
                <el-option label="下" value="bottom"/>
                <el-option label="左" value="left"/>
                <el-option label="右" value="right"/>
                <el-option label="内部" value="inside"/>
                <el-option label="内上" value="insideTop"/>
                <el-option label="内下" value="insideBottom"/>
                <el-option label="内左" value="insideLeft"/>
                <el-option label="内右" value="insideRight"/>
              </el-select>
            </el-form-item>
            <el-form-item  label="间距">
              <el-input-number v-model="emphasis.label.distance" :min="0" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="旋转">
              <el-input-number v-model="emphasis.label.rotate" :min="-90" :max="90" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="水平偏移">
              <el-input-number v-model="emphasis.label.offset[0]" :min="-100" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="垂直偏移">
              <el-input-number v-model="emphasis.label.offset[1]" :min="-100" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item label="格式" v-if="!!emphasis.label.formatter">
              <el-input v-model="emphasis.label.formatter" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="颜色">
              <el-color-picker v-model="emphasis.label.color" show-alpha size="small" @active-change="emphasisLabelColor"></el-color-picker>
            </el-form-item>
            <el-form-item  label="字体">
               <el-select v-model="emphasis.label.fontFamily" placeholder="serif" size="mini">
                <el-option label="serif" value="serif"/>
                <el-option label="monospace" value="monospace"/>
                <el-option label="Courier New" value="Courier New"/>
                <el-option label="Microsoft YaHei" value="Microsoft YaHei"/>
              </el-select>
            </el-form-item>
            <el-form-item  label="字号">
              <el-input-number v-model="emphasis.label.fontSize" :min="0" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="粗细">
              <el-select v-model="emphasis.label.fontWeight" placeholder="normal" size="mini">
                <el-option label="normal" value="normal"/>
                <el-option label="bold" value="bold"/>
                <el-option label="bolder" value="bolder"/>
                <el-option label="lighter" value="lighter"/>
              </el-select>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>

export default {
  data: function () {
    return {
    }
  },
  methods: {
    labelColor (val) {
      this.label.color = val
    },
    emphasisLabelColor (val) {
      this.emphasis.label.color = val
    }
  },
  computed: {
    label () {
      return this.$store.state.layout[this.$store.state.activeArrayIndex].SlideContent[this.$store.state.insideActiveArrayIndex].itemContent.detail.label
    },
    emphasis () {
      return this.$store.state.layout[this.$store.state.activeArrayIndex].SlideContent[this.$store.state.insideActiveArrayIndex].itemContent.detail.emphasis
    }
  },
  watch: {
  },
  components: {
  }
}
</script>

<style scoped>
    .el-form-item {
        margin-bottom: 0px
    }
</style>
